package cn.edu.scau.cmi.youbaiquan.composite.consistent;

import java.util.ArrayList;

public class ConsistentDepartment implements ConsistentComponent {

	private ArrayList<ConsistentComponent> children = new ArrayList<>();
	private String name = null;
	
	public ConsistentDepartment(String name) {
		this.name = name;
	}
	
	@Override
	public boolean add(ConsistentComponent c) {
		return children.add(c);
	}

	@Override
	public boolean remove(ConsistentComponent c) {
		return children.remove(c);
	}
	
	@Override
	public ArrayList<ConsistentComponent> getChild() {
		// TODO Auto-generated method stub
		return children;
	}
	
	@Override
	public String operation() {
		return this.toString() + "——开始签到打卡";
	}
	
	@Override
	public String toString() {
		return this.name;
	}

}
